package com.guangyunl.e_recursion;
// 需求:求n!(n的阶乘)
public class Demo03Recursion {
    public static void main(String[] args) {
        int method = method(3);
        System.out.println("method = " + method);
    }

    public static int method(int n){
        if(n<=1){
            return n;
        }else{
            return n*method(n-1);
        }
    }
}
/*
method = 6
 */